namespace Study306 {

  class Person {



    constructor(
      public name: string,
      public age: number,
      public isActive: boolean,
      public sex: string
    ) { }
  }


  // 提取类的属性类型并生成新的类型
  type PersonDetails = Pick<Person, keyof Person>;

  class Son extends Person {


    constructor(superArg: PersonDetails, public sname: string) {
      // 解构 superArg 对象，将其属性传递给父类构造函数
      const { name, age, isActive, sex } = superArg;
      super(name, age, isActive, sex);
    }
  }


  // 使用示例
  const son = new Son({
    name: '223',
    age: 32,
    isActive: true,
    sex: 'nan'
  }, "SonName");
  console.log(son);



}

